package com.example.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.pojo.HpDoc;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.repository.query.Param;

import java.util.List;
@Mapper
public interface HpDocMapper {

    @Select("SELECT * FROM hp_doc WHERE hp_id = #{hpId} AND deptno = #{deptno}")
    List<HpDoc> findByHpIdAndDeptno(@Param("hpId") Integer hpId, @Param("deptno") Integer deptno);

    @Select("SELECT * FROM hp_doc WHERE hp_id = #{hpId} AND deptno = #{deptno}\n" +
            " */")
    HpDoc selectOneByHpIdAndDeptno(Integer hpId, Integer deptno);

    List<HpDoc> selectList(QueryWrapper<HpDoc> queryWrapper);

    @Select("SELECT * FROM hp_doc WHERE deptno = #{deptno} AND hp_id = #{hpId}")
    List<HpDoc> findByDeptnoAndHpId(Integer deptno, Integer hpId);
}
